package shapes;
import java.awt.Color;
public class rectangle extends shape
{
		point2d topLeft;
		float ln;
		float wid;
		
		//CONSTRUCTORS
		public rectangle(String n,String t,int bW,Color bC,Color fC, point2d p,float l,float w) 
		{
			super.setShape(n, t, bW, bC, fC);
			topLeft = p;
			ln=l;
			wid=w;
		}
		
		public void setRectangle(String n,String t,int bW,Color bC,Color fC, point2d p,float l,float w)
		{
			super.setShape(n,t,bW,bC,fC);
			topLeft.setX(p.getX());
			topLeft.setY(p.getY());
			ln=l;
			wid=w;
		}
		
//GETTERS
		public point2d getTopLeft()
		{
			return topLeft;
		}
		public float getLn()
		{
			return ln;
		}
		public float getWid()
		{
			return wid;
		}
		//SETTERS
		public void setTopLeft(point2d p)
		{
			topLeft.setX(p.getX());
			topLeft.setY(p.getY());
		}
		public void setLn(float l)
		{
			ln=l;
		}
		public void setWid(float w)
		{
			wid=w;
		}
		
		float area()
		{
			return ln*wid;
		}
		public String toString()
		{
			String s= "Rectangle at " + topLeft.toString() + " of length " + getLn()+" and width " +getWid();
			return s;
		}
		
}
